<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link rel="stylesheet" type="text/css" href="view/controller.css"/>
	<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
	<title>myScheduleChange</title>
</head>
<body>
	<div class="header">
		<jsp:include page="head_controller.html"/>
	</div>
	<div class="sidebar">
	<jsp:include page="navigation_admin.jsp"/>
	</div>
	<div class="page">
	<a href="AdminVerwaltung.s"><c:out value="${title_up}"/></a> >> <c:out value="${title_med}"/>
		<br/>
		<br/>
		<h1><c:out value="${message}"/></h1>
		<form method="post" action="AdminGetVorlesungsverschiebungen.s">
		<table>
			<tr>
				<td>
					<!-- Dynamisches Dropdown Menü zur Auswahl des Studiengangs -->
					<select name="studiengang">
						<option value="0">W&auml;hle den Studiengang</option>
						<!-- Schleife durchläuft alle Studiengangsobjekte und zeigt den Namen im Dropdownmenü an -->
						<c:forEach items="${studiengaenge}" var="studiengang">
							<option value="${studiengang.idStudiengang}" <c:if test="${studiengang.idStudiengang==studgangID}">SELECTED</c:if>><c:out value="${studiengang.name}"/></option>
						</c:forEach>	 
					</select>
				</td>
				<td>
					<select name="semester">
						<option value="0">W&auml;hle das Semester</option>
							<% for(int i=1; i<=7; i++) {%>
							<c:set var="id" value="<%=i%>"/>
							<option value="<%=i%>" <c:if test="${id==semesterID}">SELECTED</c:if>><%=i%>.Semester</option>
							<%  }   %>
					</select>
				</td>
				<td><input type="submit" name="submit" value="Anzeigen"/></td>
			</tr>
		</table>
		</form>
		<br/>
		<p class="error"><c:out value="${novv}"/></p>
		<table cellpadding="5">
			<tr>
				<th>Kursname</th>
				<th>Datum</th>
				<th>Zeitraum</th>
				<th>Raum</th>
				<th>Dozent</th>
				<th>Notiz</th>
				<th></th>
			</tr>
			<c:forEach items="${verschiebungen}" var="verschiebung">
			<tr>
				<td><c:out value="${verschiebung.kursname}"/></td>
				<td><c:out value="${verschiebung.datumstring}"/></td>
				<td><c:out value="${verschiebung.zeitraum}"/></td>
				<td><c:out value="${verschiebung.raum}"/></td>
				<td><c:out value="${verschiebung.dozentname}"/></td>
				<td><c:out value="${verschiebung.notiz}"/></td>
				<td>
					<a href="AdminAddGetVorlesungsverschiebungen.s?kursname=<c:out value="${verschiebung.kursname}"/>&datum=<c:out value="${verschiebung.datumstring}"/>&zeitraum=<c:out value="${verschiebung.zeitraum}"/>&raum=<c:out value="${verschiebung.raum}"/>&dozentenname=<c:out value="${verschiebung.dozentname}"/>&notiz=<c:out value="${verschiebung.notiz}"/>&studiengang=<c:out value="${studgangID}"/>&semester=<c:out value="${semesterID}"/>&add=1">
					<input name="add" type="button" value="Hinzuf&uuml;gen" />
					</a>
				</td>
			</tr>
			</c:forEach>
		</table>
	</div>
</body>
</html>